<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                template="./template/HomemasterAd.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:define name="content_top">
        Users
    </ui:define>

    <ui:define name="content">
        <h3 style="color: blue; ">Edit</h3>
        <h:form prependId="false">
            <p:panelGrid columns="2">
                <p:outputLabel value="Username"></p:outputLabel>
                <p:outputLabel value="#{usersManagedBean.user.username}"></p:outputLabel>

                <p:outputLabel value="Fullname"></p:outputLabel>
                <p:inputText value="#{usersManagedBean.user.fullname}" maxlength="50"></p:inputText>

                <p:outputLabel value="Gender" for="gender"></p:outputLabel>
                <p:selectOneRadio id="gender" value="#{usersManagedBean.user.gender}">
                    <f:selectItem itemLabel="Male" itemValue="Male" />
                    <f:selectItem itemLabel="FeMale" itemValue="FeMale" />
                    <f:selectItem itemLabel="Other" itemValue="Other" />
                </p:selectOneRadio>

                <p:outputLabel value="Birth date"></p:outputLabel>
                <p:calendar id="ngaysx" value="#{usersManagedBean.user.birthdate}" pattern="dd/MM/yyyy" timeZone="#{usersManagedBean.tm}" maxlength="10" maxdate="#{usersManagedBean.maxDate()}" readonlyInput="true"></p:calendar>

                <p:outputLabel value="Email"></p:outputLabel>
                <p:outputLabel value="#{usersManagedBean.user.email}"></p:outputLabel>

                <p:outputLabel value="Address"></p:outputLabel>
                <p:inputText value="#{usersManagedBean.user.address}" maxlength="50"></p:inputText>

                <p:outputLabel value="Phone"></p:outputLabel>
                <p:inputText value="#{usersManagedBean.user.phone}" maxlength="20"></p:inputText>

                <p:outputLabel value="Date Created"></p:outputLabel>
                <p:outputLabel value="#{usersManagedBean.user.dateCreated}">
                    <f:convertDateTime pattern="dd/MM/yyyy" timeZone="#{usersManagedBean.tm}"></f:convertDateTime>
                </p:outputLabel>
                <p:outputLabel value="Status"></p:outputLabel>
                <p:selectBooleanCheckbox id="tinhtrang" value="#{usersManagedBean.user.status}"></p:selectBooleanCheckbox>

                <p:outputLabel value="Role"></p:outputLabel>
                <p:selectOneMenu value="#{usersManagedBean.user.role}">
                    <f:selectItem itemValue="Role_Admin" itemLabel="Role_Admin"/>
                    <f:selectItem itemValue="Role_User" itemLabel="Role_User"/>
                </p:selectOneMenu>

                <p:outputLabel value=""></p:outputLabel>
                <p:commandButton value="Save" action="#{usersManagedBean.xulycapnhat()}" ajax="false"></p:commandButton>
            </p:panelGrid>
        </h:form>
    </ui:define>

</ui:composition>
